package com.mcf.xiaolinju.controller;


import com.mcf.xiaolinju.service.impl.DynamicServiceImpl;
import com.mcf.xiaolinju.vo.DynamicVO;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mcf
 * @since 2022-02-20
 */
@CrossOrigin
@RestController
@RequestMapping("/xiaolinju/dynamic")
public class DynamicController {
    @Resource
    DynamicServiceImpl dynamicService;
    //小程序公告的添加
    @RequestMapping("/addapi")
    public String addapi(String content,int createid,String pictureurl,int communityid){

        return  dynamicService.addapi(content,createid,pictureurl,communityid);
    }
    @RequestMapping("/selectallDynamic")
    //小程序查询动态的信息
    public List<DynamicVO> selectallDynamic(int id,int userid){
        return dynamicService.selectallDynamic(id,userid);
    }
    @RequestMapping("/selectoneDynamic")
    public DynamicVO selectoneDynamic(int id,int keyid){
        return dynamicService.selectoneDynamic(id,keyid);
    }


}
